package cn.baiweigang.uu.enums;

public enum ContractCodeEnum {
    BTC_USDT("BTC-USDT", "BTC永续合约USDT"),
    BTC_USD("BTC-USD", "币本位合约 BTC"),
    BTC_CQ("BTC_CQ", "交割合约-当季"),
    BTC("BTC", "交割合约"),
    ;

    private String code;
    private String desc;

    ContractCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ContractCodeEnum byCode(String code) {
        ContractCodeEnum[] contractCodeEnums = ContractCodeEnum.values();
        for (int i = 0; i < contractCodeEnums.length; i++) {
            if (contractCodeEnums[i].getCode().equalsIgnoreCase(code)) {
                return contractCodeEnums[i];
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
